package com.intelligentclass.repositories;

import com.intelligentclass.entity.Commit;
import com.intelligentclass.entity.Homework;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface CommitRepository extends JpaRepository<Commit, Integer> {
    @Query("select c from Commit c where c.sno = :sno and c.hid = :hid")
    public Commit findByHidAndSno(@Param("hid") int hid, @Param("sno") String sno);

    @Query("select c from Commit c where c.hid = :hid")
    public List<Commit> findCommits(@Param("hid") int hid);
}
